{extend name='admin@public/content'}

{block name="content"}
<form autocomplete="off" onsubmit="return false;" action="{:request()->url()}" data-auto="true" method="post" class='form-horizontal layui-form padding-top-20'>

    <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
        <ul class="layui-tab-title">
            <li class="layui-this">基本信息</li>
            <li>工人信息</li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <div class="form-group">
                    <label class="col-sm-2 control-label">用工开始时间</label>
                    <div class='col-sm-8'>
                        <input autofocus readonly name="start_time" value="{$vo.start_time|date='Y-m-d H:i:s'}" title="请选择开始时间" placeholder="请选择开始时间" class="layui-input js_time_box">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">用工结束时间</label>
                    <div class='col-sm-8'>
                        <input readonly name="end_time" value="{$vo.end_time|date='Y-m-d H:i:s'}" title="请选择结束时间" placeholder="请选择结束时间" class="layui-input js_time_box">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">抢单结束时间</label>
                    <div class='col-sm-8'>
                        <input readonly name="grab_sheet_end_time" value="{$vo.grab_sheet_end_time|date='Y-m-d H:i:s'}" title="请选择抢单结束时间" placeholder="请选择结束时间" class="layui-input js_time_box">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">用工地址</label>
                    <div class='col-sm-8'>
                        <input name="address" value="{$vo.address}" title="请输入用工地址" placeholder="请输入用工地址" class="layui-input">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label label-required">图片</label>
                    <div class='col-sm-8'>
                        <table class="layui-table background-item margin-none" lay-size="sm" lay-skin="nob">
                            <thead>
                            <tr>
                                <td>图片</td>
                            </tr>
                            </thead>
                            <tbody>
                            <tr>
                                <td class="text-top">
                                    <input type="hidden" name="image" value="{$vo.image|default=''}">
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                <script>
                    $('input[name="image"]').uploadMultipleImage();
                </script>
                <div class="form-group">
                    <label class="col-sm-2 control-label">工作描述</label>
                    <div class='col-sm-8'>
                        <textarea name="desc" class="form-control">{$vo.desc|default=''|htmlspecialchars_decode}</textarea>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">是否加班</label>
                    <div class='col-sm-8'>
                        <label class="think-checkbox"><input lay-ignore class="list-check-box" {$vo['is_overtime']==1?'checked':''} type="checkbox" value="1" name="is_overtime"/> 加班</label>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">加班费</label>
                    <div class='col-sm-8'>
                        <input name="overtime_fee" value="{$vo.overtime_fee}" title="请输入加班费" placeholder="请输入加班费" class="layui-input">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">生活</label>
                    <div class='col-sm-8'>
                        {volist name="lifes" id="life"}
                        <label class="think-checkbox">
                            <input lay-ignore class="list-check-box" type="checkbox" value="{$life.id}" name="life_ids[]" {in name="life.id" value="$vo.life_ids"}checked{/in}/> {$life.title}
                        </label>
                        {/volist}
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">支付方式</label>
                    <div class='col-sm-8'>
                        {volist name="paytypes" id="paytype"}
                        <label class="think-radio"><input lay-ignore type="radio" {$vo['pay_type']==$paytype['id']?'checked':''} value="{$paytype['id']}" name="pay_type"/> {$paytype['title']}</label>
                        {/volist}
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label">状态</label>
                    <div class='col-sm-8'>
                        <label class="think-radio"><input lay-ignore type="radio" {$vo['status']=='0'?'checked':''} value="0" name="status"/> 待审核</label>
                        <label class="think-radio"><input lay-ignore type="radio" {$vo['status']=='1'?'checked':''} value="1" name="status"/> 抢单中</label>
                        <label class="think-radio"><input lay-ignore type="radio" {$vo['status']=='2'?'checked':''} value="2" name="status"/> 已结束</label>
                        <label class="think-radio"><input lay-ignore type="radio" {$vo['status']=='3'?'checked':''} value="3" name="status"/> 已成交</label>
                    </div>
                </div>

            </div>
            <div class="layui-tab-item">
                {volist name="vo['worker_info']" id="worker_info" key="_key"}
                <div class="form-group">
                    <label class="col-sm-2 control-label">工人信息{$_key}</label>
                    <div class='col-sm-8'>
                        <select class="w30" name="wi_type[{$_key}]">
                            {volist name="workerCates" id="workerCate"}
                            <option value="{$workerCate.id}" {$workerCate['id']==$worker_info['type']?'selected':''}>{$workerCate.title}</option>
                            {/volist}
                        </select>
                        <input name="wi_number[{$_key}]" value="{$worker_info['number']}" title="请输入数量" placeholder="请输入数量" class="layui-input w30">
                        <input name="wi_price[{$_key}]" value="{$worker_info['price']}" title="请输入工价" placeholder="请输入工价" class="layui-input w30">
                    </div>
                </div>
                {/volist}
            </div>
        </div>
    </div>

    <div class="hr-line-dashed"></div>

    <div class="col-sm-7 col-sm-offset-2">
        <div class="layui-form-item text-center">
            {if !empty($vo.id)}
            <input type="hidden" name="id" value="{$vo.id}">
            {/if}
            <button class="layui-btn" type="submit">保存</button>
            <button class="layui-btn layui-btn-danger" type='button' onclick="window.history.back()">取消</button>
        </div>
    </div>

    <style>
        .background-item {
            padding: 15px;
            background: #efefef;
        }
        .no_border{border:none;}
        .background-item thead tr {
            background: #e0e0e0
        }
        .layui-form-select,.w30{width: 30%;float: left;}
    </style>
    <script>
        window.form.render();
        layui.use('laydate', function(){
            var laydate = layui.laydate;

            laydate.render({
                elem: 'input.js_time_box',
                btns: ['now', 'confirm'],
                type:'datetime'
            });
        });
    </script>
</form>
{/block}